# 根据输入第几代，输出第几代人的信息
import initial


def showInfo(person):
    print('姓名:' + person.name)
    print('性别:' + person.gender)
    print('出生日期:' + person.birth)
    print('父亲:' + person.father.name)
    print('婚否:' + person.marry)
    print('地址:' + person.address)
    print('电话:' + person.tel)
    print('QQ:' + person.qqNum)
    print('email:' + person.email)
    print('-----')


def select(x, count, generation):
    count += 1
    if len(x) == 0:
        return
    else:
        for i in x:
            if count == generation:
                showInfo(i)
            select(i.kids, count, generation)


def selectbyGeneration():
    family = initial.get_family()
    a = [family[0]]
    print('请输入想要查询第几代人的信息')
    generation = int(input('>>>'))
    select(a, 0, generation)
